package per.sunmes.lesrb.actor;

import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.math.Matrix4;
import com.badlogic.gdx.scenes.scene2d.Group;

public class CameraGroup extends Group {

	protected OrthographicCamera camera = new OrthographicCamera();
	protected Matrix4 oldCatch = new Matrix4();

	@Override
	public void draw(Batch batch, float parentAlpha) {
		oldCatch.set(batch.getProjectionMatrix());
		batch.setProjectionMatrix(camera.combined);
		super.draw(batch, parentAlpha);
		batch.setProjectionMatrix(oldCatch);
	}

	public OrthographicCamera getCamera() {
		return camera;
	};

}
